$(function () {
    //line
    var d0 = [
        [0, 0], [1, 0], [2, 1], [3, 2], [4, 15], [5, 5], [6, 12], [7, 10], [8, 55], [9, 13], [10, 25], [11, 10], [12, 12], [13, 16], [14, 22], [15, 15], [16, 31], [17, 40], [18, 10], [19, 9], [20, 3], [21, 5], [22, 6], [23, 1]
    ];
    $("#flot-sp1ine").length && $.plot($("#flot-sp1ine"), [
            d0
        ], {
            series: {
                lines: {
                    show: false
                },
                splines: {
                    show: true,
                    tension: 0.4,
                    lineWidth: 1,
                    fill: 0.4
                },
                points: {
                    radius: 3,
                    show: true
                },
                shadowSize: 2
            },
            grid: {
                hoverable: true,
                clickable: true,
                tickColor: "#d9dee9",
                borderWidth: 1,
                color: '#d9dee9'
            },
            colors: ["#19b39b"],
            xaxis: {
                ticks: 12
            },
            yaxis: {
                ticks: 4
            },
            tooltip: true,
            tooltipOpts: {
                content: "访问量: %x 点有 %y 人访问",
                defaultTheme: false,
                shifts: {
                    x: 0,
                    y: 20
                }
            }
        }
    );

    // pie
    var da = [{
        label: "产品库",
        data: 40
    }, {
        label: "外包资源",
        data: 10
    }, {
        label: "新闻故事",
        data: 20
    }, {
        label: "业务需求",
        data: 12
    }];

    $("#flot-pie-donut").length && $.plot($("#flot-pie-donut"), da, {
        series: {
            pie: {
                innerRadius: 0.4,
                show: true,
                stroke: {
                    width: 0
                },
                label: {
                    show: true,
                    threshold: 0.05
                }
            }
        },
        colors: ["#65b5c2", "#4da7c1", "#3993bb", "#2e7bad"],
        grid: {
            hoverable: true,
            clickable: false
        },
        tooltip: true,
        tooltipOpts: {
            content: "%s: %p.0%"
        }
    });
});